<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<body>
	<ui:composition>
		<f:event listener="#{weeklyController.initActiveWeekly}"
			type="preRenderComponent"></f:event>

		<ui:remove>
			<p:dataGrid value="#{weeklyModel.list}" var="weekly" circular="false"
				headerText="Don't wishy-washy,just follow us. "
				footerText="#{msgs.mayBeChanged}" rows="3" style="font-size:0.8em">
			</p:dataGrid>
		</ui:remove>

		<p:panel header="#{msgs.mayBeChanged}">
			<p:accordionPanel id="weeklySelectionTable"
				value="#{weeklyModel.list}" var="weekly"
				style="width:100%;font-size:0.8em">
				<p:tab
					title="#{msgs.year}: #{weekly.year} #{msgs.week}: #{weekly.weekOfYear}">
					<p:panel
						header="#{msgs.from} #{weekly.startDateLabel} #{msgs.to} #{weekly.endDateLabel}">
						<p:dataGrid var="productPrice" value="#{weekly.productPrices}"
							paginator="true"
							paginatorTemplate=" {PreviousPageLink} {NextPageLink}"
							paginatorAlwaysVisible="false" columns="1" style="height:850px">
							<p:column style="width:100%">
								<h:panelGrid columns="2" cellspacing="5px" style="width:100%">
									<h:panelGroup>
										<h:graphicImage library="images"
											value="../#{productPrice.product.icon}32.png"></h:graphicImage>
										<h:outputText value="#{productPrice.product.nameLabel}" />
									</h:panelGroup>
									<h:panelGroup style="float:right">
										<h:outputText value="#{productPrice.specialPrice}">
											<f:convertNumber type="currency" currencySymbol="$"></f:convertNumber>
										</h:outputText>
										<h:outputText value="/#{productPrice.product.priceUnitLabel}"></h:outputText>
									</h:panelGroup>
								</h:panelGrid>
							</p:column>
						</p:dataGrid>
					</p:panel>
				</p:tab>
			</p:accordionPanel>
		</p:panel>
		<p:effect type="slide" event="load" speed="300"
			for="weeklySelectionTable" />
	</ui:composition>
</body>
</html>